<div class="panel panel-default" style="border-top: none">
  <br>
  <h3 style="color:green;text-align:center;" ng-hide="isteacher">{{manageInfo}}</h3>
  <div class="form-group" style="margin-left:20px" ng-hide="examid||!isteacher">
    <label>选择班级:</label>
    <label class="checkbox-inline" ng-repeat="klass in klasses" style="margin-left:-15px">
      <input type="radio" name="chargeklass" ng-model="$parent.selklass" value="{{klass.code}}" ng-change="selectedKlass(klass)">{{klass.name}}
    </label>
  </div>
  <div ng-show="courses" class="form-group" style="margin-left:20px">
    <label>考试课程:</label>
    <label class="checkbox-inline" ng-repeat="course in courses" style="margin-left:5px">
      <input type="checkbox" ng-model="course.checked" ng-change="selectedCourse()"> {{course.name}}
    </label>
    <label class="checkbox-inline" ng-show="courses&&courses.length>1">
      <input type="checkbox" ng-model="isSeltedAll" ng-change="selectedCourseAll()"> 所有课程
    </label>
    <a class="btn btn-info btn-sm" ng-show="selCourses.length>0" ng-click="newExam()" style="margin-left:20px">生成成绩单</a>
  </div>
  <form class="form-inline" name="form" ng-show="showExamform" style="margin-left:20px;margin-right:20px" novalidate>
    <table class="table borderless">
      <tr>
        <td style="width:95px;vertical-align:middle;">
          <label for="title">成绩单标题:</label>
        </td>
        <td>
          <input class="form-control" type="text" name="title" ng-model="title" style="width:100%" required>
        </td>
        <td style="width:95px;">
          <button type="submit" class="btn btn-primary" ng-click="saveExam()">保存成绩单</button>
        </td>
        <td style="width:95px;">
          <!-- Button trigger modal -->
          <button type="button" class="btn btn-success btn-sm" ng-show="showExamform" data-toggle="modal" data-target="#myModal">
            成绩快速录入工具
          </button>
        </td>
      </tr>
      <tr>
        <td colspan="4">
          <label>权限设定：</label>
          <label class="checkbox-inline"> <input type="checkbox" ng-model="noshare">学生只能看见自己的成绩</label>
           <span style="color:green">{{examinfo}}</span>
        </td>
      </tr>
      <tr>
        <td colspan="4">
          <textarea class="form-control" rows="3" ng-model="comment" placeholder="这里录入本次成绩单点评信息" style="width:100%"></textarea>
        </td>
      </tr>
    </table>
    <table class="table table-bordered table-condensed">
      <thead align="center">
        <tr>
          <th style="width:90px;text-align:center">学号</th>
          <th style="width:90px;text-align:center">姓名</th>
          <th style="text-align:center" ng-repeat="course in examcourses">{{course}}</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="examentry in examentries|orderBy : 'student.code'">
          <td style="width:90px;text-align:center">{{examentry.student.code}}</td>
          <td style="width:90px;text-align:center">{{examentry.student.name}}</td>
          <td style="text-align:right" ng-repeat="examscore in examentry.scores">
            <input class="tdinput" type="text" ng-next="tdinputNext($parent.$index,$index)" id="td{{$parent.$index}}{{$index}}" ng-model="examscore.value">
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td colspan="{{examcourses.length+2}}" style="text-align:right">{{createtime| date : '创建时间：yyyy年MM月dd日 hh:mm:ss' : 8}}</td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>


<!-- Modal -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-vertical-centered">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" TABINDEX="-1" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title" id="myModalLabel">成绩录入窗口</h4>
      </div>
      <div class="modal-body">
        <div class="form-group" style="margin-left:20px">
          <label>选择课程:</label>
          <label class="checkbox-inline" ng-repeat="course in examcourses" style="margin-left:-20px">
            <input type="radio" TABINDEX="-1" ng-model="$parent.scorecourse" value="{{course}}" ng-change="selectedScorescourse()">{{course}}
          </label>
          <form class="form-inline">
            <div class="form-group">
              <label for="inputCode">学号：</label>
              <input type="text" class="form-control" ng-next="endInputCode()" style="text-align:right" tabindex="-1" id="inputCode" name="code" placeholder="学号后四位" ng-model="studentCode" ng-change="codeChange(studentCode)" required>
            </div>
            <div class="form-group">
              <label for="inputName">分数：</label>
              <input type="text" class="form-control" ng-next="saveScore()" style="text-align:right" tabindex="-2" id="inputScore" name="score" placeholder="分数" ng-model="studentScore" required>
              <button type="button" class="btn btn-primary" TABINDEX="-1" ng-click="saveScore()">保存</button>
            </div>
          </form>
          <div class="form-group" style="height:auto !important;height:60px;min-height:60px;overflow-x:hidden;">
            <label style="color:green">{{scoreinfo}}</label>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" TABINDEX="-1" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
